home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / mus / misc / octaflip.lha / flipblock_allcmd.omed < prev    next >
Encoding:
Text File  |  1998-10-07  |  2.1 KB  |  70 lines

  1. /*    flipblock_allcmd.omed - arexx-script for octamed.
  2.      Flips the block including all the cmd-pages.
  3.     Made by Kjetil S. Matheussen 1998.
  4.  
  5.     Based on an arexx-script made by David T. Krupicz.
  6.     Changes: Rewritten it to work properly, included cmd-pages,
  7.     included all tracks in block, included highlight-flip,
  8.     and improoved speed with around 75%.
  9. */
  10.  
  11. OPTIONS RESULTS
  12.  
  13. ed_getnumtracks VAR numtracks
  14. ed_getnumpages VAR numpages
  15.  
  16. ed_getnumlines VAR rn_end
  17. rn_end=rn_end-1
  18. length = rn_end/2
  19.  
  20. op_update off
  21. DO e=0 to length    /* flip highlights first */
  22.     drop top_high bot_high
  23.     ed_getlinehighlight e VAR top_high
  24.     ed_getlinehighlight rn_end-e VAR bot_high
  25.     if ~(bot_high=top_high) then do
  26.         if bot_high=1 then do
  27.             ed_highlightline rn_end - e OFF
  28.             ed_highlightline e ON
  29.         end;else do
  30.             ed_highlightline rn_end - e ON
  31.             ed_highlightline e OFF
  32.         end
  33.     end
  34. END
  35. op_update on
  36.  
  37. DO r = 0 to numtracks-1
  38.     op_update off
  39.     DO i = 0 to length
  40.         drop top_note top_inum bot_note bot_inum
  41.         ed_getdata 't' r 'l' i 'note' VAR top_note          /* get top note data */
  42.         ed_getdata 't' r 'l' i 'inum' VAR top_inum
  43.         ed_getdata 't' r 'l' rn_end - i 'note' VAR bot_note          /* get BOTtom note data */
  44.         ed_getdata 't' r 'l' rn_end - i 'inum' VAR bot_inum
  45.         if ~(bot_note=top_note) then do
  46.             ed_setdata 't' r 'l' i 'note' bot_note
  47.             ed_setdata 't' r 'l' rn_end - i 'note' top_note
  48.         end
  49.         if ~(bot_inum=top_inum) then do
  50.             ed_setdata 't' r 'l' i 'inum' bot_inum
  51.             ed_setdata 't' r 'l' rn_end - i 'inum' top_inum
  52.         end
  53.         DO l = 1 TO numpages
  54.             drop top_cmdnum top_qual bot_cmdnum bot_qual
  55.             ed_getdata 't' r 'l' i 'p' l 'cmdnum' VAR top_cmdnum
  56.             ed_getdata 't' r 'l' i 'p' l 'qual' VAR top_qual
  57.             ed_getdata 't' r 'l' rn_end - i 'p' l 'cmdnum' VAR bot_cmdnum
  58.             ed_getdata 't' r 'l' rn_end - i 'p' l 'qual' VAR bot_qual
  59.             if ~(bot_cmdnum=top_cmdnum) then do
  60.                 ed_setdata 't' r 'l' i 'p' l 'cmdnum' bot_cmdnum
  61.                 ed_setdata 't' r 'l' rn_end - i 'p' l 'cmdnum' top_cmdnum
  62.             end
  63.             if ~(bot_qual=top_qual) then do
  64.                 ed_setdata 't' r 'l' i 'p' l 'qual' bot_qual
  65.                 ed_setdata 't' r 'l' rn_end - i 'p' l 'qual' top_qual
  66.             end
  67.         END
  68.     END
  69.     op_update on
  70. END